<template>
  <div>
    <div class="goods-detail">
      <el-table
        class="toolbar"
        :header-cell-style="{background:'#2F4554',color:'#FFFFFF'}"
        :data="logData"
        style="width: 100%">
        <el-table-column prop="createTime" label="操作时间" width="180"></el-table-column>
        <el-table-column prop="createName" label="操作人" width="180"></el-table-column>
        <el-table-column prop="remark" label="操作日志"></el-table-column>
      </el-table>
      <el-pagination
        layout="total, prev, pager, next, jumper,sizes"
        @current-change="handleCurrentChange"
        :current-page="start"
        :page-size="limit"
        :total="total"
        style="float:right;"
        :page-sizes="[10, 20, 30, 40]"
        @size-change="handleSizeChange"
      ></el-pagination>
    </div>
  </div>
</template>


<script>
 export default {
   /*props:["afterSaleNo"],*/
   data(){
     return{
       //售后单日志
       logData: [
         {
           total:0,
           start:1,
           limit:10,
           createTime:"2018-12-04 9:22:13",
           createName:"国网平台",
           remark:"订单推送至OMS"
         }
       ],
     }
   },
   watch: {
     afterSaleNo:function(newVal,oldVal){
       if(newVal!=''){
         this.getList(newVal);
       }
     }
   },
   created:function(){
   },
   methods:{
     getList(no){
       //获取审核结果列表
       let this_ = this;
       this.utils.request.getOrderAfterSaleFlowRecordsPage({"afterSaleNo": no,"start":this_.start,"limit":this_.limit}, function (res) {
         if (res.code == "0000") {
           // let auditResult = res.data.find(function (item, index) {
           //   return item.operateType == 1030 || item.operateType == 1040;
           // })
           // if (typeof (auditResult) != "undefined") {
           //   //this_.auditTime = auditResult.createTime;
           //   this_.auditResult = auditResult.operateType == 1030 ? '审核通过' : '审核拒绝';
           //   this_.remarks = auditResult.remark;
           // }
           this_.total = Number(res.data.total);
           this_.logData = res.data.rows;
         }
       });
     },
     handleSizeChange(val) {
       this.limit = val
       this.getList(this.afterSaleNo);
     },
     handleCurrentChange(val) {
       this.start = val;
       this.getList(this.afterSaleNo);
     }

   }
   }
</script>

<style>
</style>
